﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using PumpCentralInterfaces;
using PumpCentral_Domain.AlarmSubSystem;
using PumpCentral_Domain.MonitoringSubSystem;

using System.Diagnostics;


namespace PumpCentral_Domain
{    
    public delegate void PumpRegistrationHandler(Pump pumpObject);
    public class PumpCentralSystem
    {
        public event PumpCommunicationEventHandler PumpRegistered;
        AlarmSystem alarmSystem = new AlarmSystem();
        PumpMonitoringModule MonitoringModule = new PumpMonitoringModule();
        PumpServiceGateway ServiceGateway;
        
        public PumpCentralSystem()
        {
            MonitoringModule.WarningRaised += OnMonitoringModule_WarningRaised;
            MonitoringModule.AlarmRaised += OnMonitoringModule_AlarmRaised;
            ServiceGateway = new PumpServiceGateway(this);
            ServiceGateway.PumpRegisterationRecieved += ServiceGateway_PumpRegistered;
        }

        private void ServiceGateway_PumpRegistered(Pump pump)
        {
            PumpRegistered(pump);
        }

        public List<Pump> GetDataFromAllPumps()
        {
            return ServiceGateway.getAllPumps();
        }

        void OnMonitoringModule_AlarmRaised()
        {
            
        }

        void OnMonitoringModule_WarningRaised()
        {

        }

        

        
    }
}
